package com.simulated.communication;

import com.github.tobato.fastdfs.FdfsClientConfig;
import com.simulated.communication.ossd.DisableAccessWarnings;
import com.simulated.communication.utils.SpringUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableMBeanExport;
import org.springframework.context.annotation.Import;
import org.springframework.jmx.support.RegistrationPolicy;
import org.treeleafj.xdoc.boot.EnableXDoc;

/**
 * @author Markburt
 * @version 0.0.0.1 bate
 * @lasttime 2020-5-2
 *
 * EnableMBeanExport  解决JMX重复注册bean的问题
 */
@EnableXDoc
@SpringBootApplication
@Import(FdfsClientConfig.class)
@EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING)
public class CommunicationApplication {

    @Bean
    public SpringUtil springUtil(){
        return new SpringUtil();
    }
    /**
     * 项目主启动类
     * @param args
     */
    public static void main(String[] args) {

        //JDK for 11 Illegal reflection
        DisableAccessWarnings.disableAccessWarnings();
        SpringApplication.run(CommunicationApplication.class, args);

    }







}
